<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/base.css" />
<link rel="stylesheet" href="css/util.css" />
<link rel="stylesheet" href="css/collect.css" />
<title>预约列表</title>
<style>
.order_list .public_input{
	margin: 10px 0;
}
.head_area .public_input span{
	width: 100px;font-size: 18px;
}
.head_area .public_input input,
.head_area .public_input select{
	width: 240px;margin-left: 10px;
}
</style>
</head>
<body>
<div class="content appointment">
	<div class="navigate_head clearfix">
		<p class="" onclick="window.location.href='appointment_list.html'">预约管理列表</p>
		<p class="navi_null"></p>
	</div>
	<!--头部功能-->
	<div class="head_area flex_vertical" style="display: block;">
		<div class="public_input">
			<span>关键词：</span>
			<input type="text" class="" placeholder="患者姓名、手机号"/>
		</div>
		<div class="public_input">
			<span>预约状态：</span>
			<select class="" style="">
				<option>全部</option>
			</select>
		</div>
		<button class="search" style="width: 70px;margin-left: 30px;">搜索</button>
		<div class="public_input">
			<span>医院：</span>
			<select class="">
				<option>全部</option>
			</select>
		</div>
		<div class="public_input">
			<span>项目分类：</span>
			<select class="">
				<option>全部</option>
			</select>
		</div>
	</div>
	<table>
		<thead>
			<tr>
				<td>预约编号</td>
				<td>患者姓名</td>
				<td>联系方式</td>
				<td>项目分类</td>
				<td>项目名称</td>
				<td>预约医院</td>
				<td>预约时间</td>
				<td>预约状态</td>
			</tr>
		</thead>
		<tbody class="tbody">
			<!--<tr>
				<td><div class="flex_all_center"><img src="img/activity_manage/select.png"/>&nbsp;<span>921614597713019</span></div></td>
				<td>2017-08-12</td>
				<td>2017-03-02</td>
				<td>176 0652 0935</td>
				<td>口腔科</td>
				<td>蔡晓云(杭州梦桃口腔门诊部)</td>
				<td>补牙</td>
				<td>预约已取消</td>
				<td>
					<button class="btn_red">删除</button>
				</td>
			</tr>-->
		</tbody>
	</table>
	<!--分页-->
	<div class="page flex_vertical">
		<button class="" onclick="indexPage()">首页</button>&nbsp;
		<button class="" onclick="backPage()"><上一页</button>&nbsp;
		<!--页码-->
		<p class="page_num">
			<!--<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span>-->
		</p>....
		<button class="" onclick="nextPage()">下一页></button>&nbsp;
		<button class="" onclick="endPage()">末页</button>&nbsp;
		共<span class="all_recode">0 </span>记录&nbsp;|
		共<span class="all_page">0 </span>页&nbsp;
		到第<input class="select_page" />页&nbsp;
		<button class="confirm_page" onclick="skipPage()">确定</button>
	</div>
</div>
<script type="text/javascript" src="plug/jquery-1.11.3.js" ></script>
<script type="text/javascript" src="plug/template-web.js"></script>
<script type="text/javascript" src="js/toggle.js" ></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/method.js"></script>
<script type="text/javascript" src="js/page.js"></script>
<script id="test_appointment_list" type="text/html">
	{{each data value}}
		<tr>
			<td>
				<div class="flex_all_center">
					<!--<img src="img/activity_manage/select.png"/>&nbsp;-->
					<span>{{value.sn}}</span>
				</div>
			</td>
			<td>{{value.fullname}}</td>
			<td>{{value.mobile}}</td>
			<td>
				{{if value.type== "doctor"}}预约项目{{else if value.type == "coupon"}}体验券{{else if value.type == "product"}}特价项目{{else if value.type == "project"}}医美项目{{/if}}
			</td>
			<td>{{value.projectName}}</td>
			<td>{{value.hospitalName}}</td>
			<td>{{value.reservationDate}}</td>
			<td>{{if value.status== "complete"}}已完成{{else if value.status == "success"}}已预约{{else if value.status == "cancel"}}已取消{{/if}}</td>
		</tr>
	{{/each}}
</script>

<script>
//请求方法
function reqPage(data){
	console.log(data);
	control_page.init_page(data,function(data){
		//调用ajax
		$.get_ajax("/admin/reservation/getList.json",data,function(data){
			console.log(data);
			var html = template('test_appointment_list',data);
			$(".tbody").html(html);
			//初始化分页
			control_page.currentPage(control_page.page_num,data.totalCount);
		});
	});
}
</script>
<script>
$(function(){
	reqPage(control_page.getData());
	
});
</script>
</body>
</html>
